<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="java.util.*" %>
<%@ page import="oims.*" %>
<%@ page import="order.*" %>
<% String contextPath = request.getContextPath(); %>
<%
	Customer customer = (Customer)request.getAttribute("customer");
	List<OrderRecordItem> items = (List<OrderRecordItem>)session.getAttribute("items");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<link rel="stylesheet" href="<%= contextPath %>/css/style.css" type="text/css" />
		<title>注文管理システム</title>
	</head>
	<body>
		<div>
			<table>
				<tr>
					<td width="80px">顧客番号</td>
					<td><%= customer.getNumber() %></td>
				</tr>
				<tr>
					<td>顧客名</td>
					<td><%= customer.getName() %></td>
				</tr>
				<tr>
					<td>住所</td>
					<td><%= customer.getAddress() %></td>
				</tr>
				<tr>
					<td>電話番号</td>
					<td><%= customer.getTel() %></td>
				</tr>
			</table>
		</div>
		<br />
		<div>
			<table border="1" cellspacing="0">
				<caption>注文内容を確認して下さい。</caption>
				<tr>
					<td>商品番号</td>
					<td>商品名</td>
					<td>単価</td>
					<td>数量</td>
				</tr>
				<% for (OrderRecordItem item : items) { %>
				<tr>
					<td><%= item.getProduct() %></td>
					<td><%= OrderItem.getName(item.getProduct()) %></td>
					<td align="right"><%= item.getPrice() %></td>
					<td align="right"><%= item.getQuantity() %></td>
				</tr>
				<% } %>
			</table>
		</div>
		<br />
		<form action="OrderServlet" method="post">
			<table>
				<tr>
					<td>
						<% if (items != null && items.size() > 0) { %>
						<input type="submit" value="受注する" />
						<% } %>
					</td>
					<td>
						<a class="button" href="<%= contextPath %>/order/order_edit.jsp">戻る</a>
					</td>
				</tr>
			</table>
		</form>
	</body>
</html>